<?php
	class ReflectionUtils {
		
		public static function getMethods($class) {
//			$clazz = new ReflectionClass($class);
//			return $clazz->getMethods(ReflectionMethod::IS_PUBLIC);
			try{
				return get_class_methods($class);
			} catch(Exception $e) {
				return get_class_methods(get_class($class));
			}			
		}
		
		public static function getFields($class) {
			$methods = self::getMethods($class);
			$fields = array();
			
			foreach( $methods as $method ) {
				if( strstr($method, 'set') && strlen($method) > 3 ) {
					$fields [] = Util::lcfirst(substr($method,3));
					Logger::debug("ReflectionUtils", "Field encontrado : " . Util::lcfirst(substr($method,3)));
				}
			}
			return $fields;		
		}
		
	}
?>